package com.dyit.springcloud.hospital.doctor.controller;

import com.dyit.springcloud.hospital.common.dto.HttpResp;
import com.dyit.springcloud.hospital.doctor.fegin.DoctorFegin;
import com.dyit.springcloud.hospital.doctor.service.IDeptService;
import com.dyit.springcloud.hospital.domain.entity.Dept;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;


@RestController
@RequestMapping("/api/dept")
public class DeptController {

    @Autowired
    private IDeptService ids;

    @Autowired
    private DoctorFegin df;

    @ApiOperation(value = "查询所有科室")
    @GetMapping("/findAllDept")
    public HttpResp findAllDept(){
        return new HttpResp(
                2001,
                "查询成功",
                ids.findAllDept(),
                LocalDateTime.now()
        );
    }

    //微服务下查询别人科室
    @GetMapping("/findHou")
    @ApiOperation(value = "测试侯可可",notes = "查询科室")
    public HttpResp findD(){
        return df.findD();
    }
}
